<div class="gallery-grid">
  <input type="hidden" class="action-pagedata" value="{total:<{$total}>, pagecurrent:<{$page|default:1}>, pagetotal:<{$pagetotal}>}">
  <ul class="clearfix">
    <{foreach from=$goodsData key=key item=goods}>
    <li class="goods-item">
      <{assign var='imageset' value=$env.conf.image.image.set}>
      <div class="goods-pic" style="<{if $imageset.S.width}>width:<{$imageset.S.width}>px;<{/if}><{if $imageset.S.height}>height:<{$imageset.S.height}>px;line-height:<{$imageset.S.height-2}>px;*font-size:<{$imageset.S.height * 0.9}>px;<{/if}>">
          <{if $goods.products.promotion_type_name}>

          <a <{if $opentype eq 'new_page'}>target="_blank"<{/if}> href="<{link app=starbuy ctl=site_team act=index arg0=$goods.products.product_id arg1=$goods.products.promotion_type_id}>"><img class="action-goods-img" data-src="<{$goods.image_default_id|default:$imageDefault.S.default_image|storager:'s'}>" style="<{if $imageset.S.width}>max-width:<{$imageset.S.width}>px;<{/if}><{if $imageset.S.height}>max-height:<{$imageset.S.height}>px;<{/if}>"></a>
          <{else}>
          <a target="_blank" href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>"><img class="action-goods-img" data-src="<{$goods.image_default_id|default:$imageDefault.S.default_image|storager:'s'}>"style="<{if $imageset.S.width}>max-width:<{$imageset.S.width}>px;<{/if}><{if $imageset.S.height}>max-height:<{$imageset.S.height}>px;<{/if}>"></a>
        <{/if}>
        <{if $goods.zhelv}>
          <div class="promotion_discount_g">
                <span class="en-style"><{t}><{$goods.zhelv}>折<{/t}></span>
          </div>
        <{/if}>
        <{if $goods.tags && $gallery_display_tag_goods == 'true'}>
        <{foreach from=$goods.tags item=tags}>
        <{if $tags.params.tag_showOnIndex == 'on'}>
        <{if $tags.params.tag_image}>
        <span class="img-tag-<{$tags.params.pic_loc}>" style="opacity:<{$tags.params.tag_opacity / 100}>;filter:alpha(opacity=<{$tags.params.tag_opacity}>)"><img src="<{$tags.params.tag_image|storager}>"></span>
        <{else}>
        <span class="text-tag-<{$tags.params.pic_loc}>" style="background-color:<{$tags.tag_bgcolor|default:'transparent'}>;color:<{$tags.tag_fgcolor}>;opacity:<{$tags.params.tag_opacity / 100}>;filter:alpha(opacity=<{$tags.params.tag_opacity}>)"><{$tags.tag_name}></span>
        <{/if}>
        <{/if}>
        <{/foreach}>
        <{/if}>
      </div>
      <div class="goods-info">
        <{if !isset($goods.prepare)}>
          <{if $goods.products.promotion_type_name }>
            <h3 class="goods-name" style="float: left;">
              <a <{if $opentype eq 'new_page'}>target="_blank"<{/if}> href="<{link app=starbuy ctl=site_team act=index arg0=$goods.products.product_id arg1=$goods.products.promotion_type_id}>" style="font-size:18px;line-height: 100%;"><{$goods.name|t:'b2c'}></a>
            </h3>
            <{else}>
            <h3 class="goods-name" style="float: left;"><a <{if $opentype eq 'new_page'}>target="_blank"<{/if}> href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>" style="font-size:18px;line-height: 100%;"><{$goods.name|t:'b2c'}></a></h3>
          <{/if}>
          <div style="float:right;margin-right:10px;font-size:12px;color:#b5b5b5;">
            <{t}>库存<{/t}>：<span id="product_store_<{$goods.products.bn}>"><{$goods.jxc_store|t:'b2c'}></span><{t}><{$goods.unit|default:"米"}><{/t}>
          </div>
          <div style="clear:both;"></div>
        <{/if}>
         <!--预售商品的显示判断-->
        <{if $goods.prepare.promotion_type == 'prepare'}>
        <h3 class="goods-name"><a <{if $opentype eq 'new_page'}>target="_blank"<{/if}> href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>"><{$goods.name|t:'b2c'}></a>&nbsp;<e style="background-color: #ff0000;color:#fff">预售</e></h3>
        <{/if}>
        <div class="goods-basic-info clearfix">
          <div class="goods-price" style="float:left;">
            <ins class="price">
                <{if $goods.NoShow}>
                  ¥<{t}>注册会员可见<{/t}>
                <{elseif $NOPRICE}>
                  <span class="goods_price_new">***</span>
                <{else}>
                <span class="goods_price_new"><{$goods.products.price|cur_odr}></span>
                <{if $goods.products.mktprice >0}>
                <span class="goods_price_old"><{$goods.products.mktprice|cur_odr}></span>
                <{/if}>
                <{/if}>
            </ins>
            <{if $point_status == 'on'}>
            <{if $goods.comments_count > 0}>
            <{if $commentListListnum=='true'}>
            <span class="goods-comment"><a href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>#product_comment"><b><{$goods.comments_count}></b><{t}>条评论<{/t}></a></span>
            <{/if}>
            <{else}>
            <{if $commentListListnum=='true'}>
            <span class="goods-comment"><{t}>暂无评论<{/t}></span>
            <{/if}>
            <{/if}>
            <{/if}>
            <!-- <{if $env.conf.b2c.site.show_mark_price == 'true'}>
            <del class="price"><{$goods.products.mktprice|cur_odr}></del>
            <{/if}> -->
          </div>
        </div>
      </div>

      <div class="promotion-tags">
        <{if $goods.promotion_tags && $env.conf.b2c.gallery.display.promotion == 'true'}>
        <{foreach from=$goods.promotion_tags item=pTag}>
        <span class="tag"><{$pTag.tag_name}></span>
        <{/foreach}>
        <{/if}>
    <{if $goods.products.promotion_type_name }>
        <span class="tag"><{$goods.products.promotion_type_name}></span>
        <{/if}>

      </div>
      <div class="goods-action">
        <!--预售商品的显示判断-->
      <{if !isset($goods.prepare)}>
          <div class="goods-buy">
            <{if $goods.products.store > 0}>
              <!-- 加入购物车 -->
              <{if $goods.fastbuy}>
              <{if $env.conf.b2c.gallery.display.buynum == 'true'}>
              <span class="p-quantity">
                <a href="javascript:void(0);" class="btn-decrease">-</a><input type="text" min="1" max="<{$goods.products.store|number}>" size="2" name="goods[num]" class="action-quantity-input" value="1"><a href="javascript:void(0);" class="btn-increase">+</a>
              </span>
              <input type="hidden" name="goods[goods_id]" value="<{$goods.goods_id}>">
              <input type="hidden" name="goods[product_id]" value="<{$goods.products.product_id}>">
              <{/if}>
              <{if $env.conf.b2c.site.buy.target == '2'}>
              <{assign var='buytarget' value='_blank_cart'}>
              <{elseif $env.conf.b2c.site.buy.target == '3'}>
              <{assign var='buytarget' value='_dialog_minicart'}>
              <{/if}>
              <a class="btn btn-major action-addtocart" href="<{link app=b2c ctl=site_cart act=add arg0=goods arg1=$goods.goods_id arg2=$goods.products.product_id arg3=1}>"<{if $buytarget}> target="<{$buytarget}>"<{/if}>><span><span>加入购物车</span></span></a>
            <{/if}>
              <a class="btn btn-major" target="_blank" href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>"><span><span><{t}>查看详情<{/t}></span></span></a>
          <{else}>
              <a class="btn btn-major" target="_blank" href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>"><span><span><{t}>查看详情<{/t}></span></span></a>
          <{/if}>
          </div>
           <{else}>
        <!--预售商品-->
          <div class="goods-buy">

            <!-- 加入购物车 -->
            <span class="p-quantity">
              <input type="text" min="1" readonly="true" max="<{$goods.products.store|number}>" size="2" name="goods[num]" class="action-quantity-input" value="1">

            </span>
            <input type="hidden" name="goods[goods_id]" value="<{$goods.goods_id}>">
            <input type="hidden" name="goods[product_id]" value="<{$goods.products.product_id}>">


            <a class="btn btn-major"  href="<{link app=b2c ctl=site_product arg0=$goods.products.product_id}>"><span><span>立即预定</span></span></a>

          </div>
        <{/if}>
        <div class="goods-others">
          <{if $login=='nologin'}>
          <a href="<{link app=b2c ctl=site_passport act=login}>" class="btn btn-simple"><span><span><{t}>收藏<{/t}></span></span></a>
          <{else}>
          <{if !$goods.is_fav}>
          <button type="button" class="btn btn-simple" rel="_favbtn_" data-gid="<{$goods.goods_id}>"><span><span><{t}>收藏<{/t}></span></span></button>
          <button type="button" class="btn btn-plane" rev="_favbtn_" style="display:none;"><span><span><{t}>已收藏<{/t}></span></span></button>
          <{else}>
          <button type="button" class="btn btn-simple" rel="_favbtn_" data-gid="<{$goods.goods_id}>" style="display:none;"><span><span><{t}>收藏<{/t}></span></span></button>
          <button type="button" class="btn btn-plane" rev="_favbtn_"><span><span><{t}>已收藏<{/t}></span></span></button>
          <{/if}>
          <{/if}>
        </div>
      </div>
    </li>
    <{/foreach}>
  </ul>
</div>
<{pagers data=$pager}>
<script type="text/javascript">
  //如果是英文版
    var isEn = document.cookie.indexOf('en_US')>0 ? true :false;
    if(isEn) {
      $$('.en-style').setStyles({
        "margin-right": "25px",
        "margin-top": "25px",
        "font-size": "14px",
        "padding-right": "0px"
      });
    }
    window.addEvent('domready', function() {
    $('gallery_show').getElements('li').each(function(item) {
        item.addEvents({
            "mouseover": function() {
                item.addClass("active")
            },
            "mouseout": function() {
                item.removeClass("active")
            }
        })
    })
})
</script>